﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using IMDBApi.Contracts;
using IMDBApi.Contracts.Entities;
using IMDBApi.Contracts.Entities.Title.MainDetail;
using IMDBApi.Contracts.Entities.Title.Photos;
using IMDBApi.Contracts.Entities.Title.PlotSummary;
using IMDBApi.Contracts.Entities.Title.Quotes;
using IMDBApi.Contracts.Entities.Title.Synposis;
using IMDBApi.Contracts.Entities.Title.Trivia;
using IMDBApi.Contracts.Entities.Title.UserReviews;
using IMDBApi.Contracts.Entities.Title.FullCredits;
using IMDBApi.Contracts.Entities.Title.Episodes;
using IMDBApi.Contracts.Entities.Title.ExternalReviews;
using IMDBApi.Contracts.Entities.Search;

namespace IMDBApi.Tests.UnitTest
{
    [TestClass]
    public class UnitTestSearch
    {
        [TestMethod]
        public void TestIMDBSearch()
        {
            string json = new IMDBSearch().GetSearchResults("Moulin Rouge");
            Search searchResults = JSONSerializer.Deserialize<Search>(json);

            Assert.IsNotNull(searchResults.Data);
        }

        [TestMethod]
        public void TestCreateSearchTerm()
        {
            string searchTerm = new Query().CreateSearchTerm("Zombie.Dawn.2011.German.AC3.BDRiP.XviD-LeetXD");

            Assert.AreNotEqual(searchTerm, string.Empty);
        }
    }
}
